class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {

        unordered_set<int> hash;
        for (auto x : nums)
            if (hash.count(x))
                return true;
            else
                hash.insert(x);
        return false;

    }
};